package com.xuzz.study.spring.autowired;

import java.util.Collections;
import java.util.List;

/**
 * @description:
 * @author: xuzz
 * @create: 2020-02-27 16:04
 */
public class MockRestTemplate {

    private List<Interceptor> interceptors = Collections.emptyList();

    public List<Interceptor> getInterceptors() {
        return interceptors;
    }

    public void setInterceptors(List<Interceptor> interceptors) {
        this.interceptors = interceptors;
    }
    public void get()
    {
        String req = "message from fur:i want to get something";
        this.interceptors.forEach(i->{
            i.invoke(req);
        });
        System.out.println(req);
    }

    public interface Interceptor
    {
        public void invoke(String preMsg);
    }
}
